//
//  ViewController.m
//  OC-NetworkTools
//
//  Created by 范英强 on 16/1/27.
//  Copyright © 2016年 范英强. All rights reserved.
//

#import "ViewController.h"
#import <AFNetworking/AFNetworking.h>
#import "HMNetworkTools.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    [[HMNetworkTools sharedTools] requset:GET url:@"http://www.weather.com.cn/data/sk/101010100.html" params:nil success:^(id responseObject) {
        NSLog(@"成功%@",responseObject);
    } failure:^(NSError *error) {
        
    }];
    
    
    
}

- (void)demo{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    
    
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
    [manager GET:@"http://www.weather.com.cn/data/sk/101010100.html" parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSLog(@"成功%@",responseObject);
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"失败%@",error);
    }];
    
}



@end
